home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / andere sprachen / gamesmaster / includes / games / games.i < prev    next >
Encoding:
Text File  |  1996-07-16  |  12.9 KB  |  441 lines

  1. **
  2. **    $VER: games.i 0.2 (05.7.96)
  3. **    Includes Release xx.xx
  4. **
  5. **    (C) Copyright 1996 DreamWorld Productions.
  6. **        All Rights Reserved
  7. **
  8.  
  9.     IFND    EXEC_TYPES_I
  10.     include 'exec/types.i'
  11.     ENDC
  12.  
  13. FILTER_OFF =    0
  14. FILTER_ON =    1
  15.  
  16. * --- Universal JoyStatus bits returned from Read_JoyStick, Sega, JoyPad,
  17. *     etc...
  18.  
  19. JS_LEFT    =    0                    ;X axis
  20. JS_RIGHT =    1
  21. JS_UP =        2                    ;Y axis
  22. JS_DOWN    =    3
  23. JS_ZIN =    4                    ;Z axis!  Reserved for later...
  24. JS_ZOUT =    5
  25. JS_FIRE1 =    6                    ;Standard Fire Button (1).
  26. JS_FIRE2 =    7                    ;Standard Fire Button (2).
  27.  
  28. JS_RED =    6                    ;CD32 Fire button (1).
  29. JS_BLUE =    7                    ;CD32 Fire button (2).
  30. JS_PLAY =    8                    ;Other CD32 buttons here.
  31. JS_RWD =    9
  32. JS_FFW =    10
  33. JS_GREEN =    11
  34. JS_YELLOW =    12
  35.  
  36. JB_FIRE1 =    16                   ;For the ZBXY style return type
  37. JB_FIRE2 =    17                   ; (analog joysticks)
  38.  
  39. M_LMB    =    0
  40. M_RMB    =    1
  41. M_MMB    =    2
  42.  
  43. JT_SWITCH =    0
  44. JT_ZBXY =    1
  45.  
  46. * --- Joyport names for calling Read_JoyStick/Mouse/JoyPad...()
  47.  
  48. JPORT1    =    0*2
  49. JPORT2    =    1*2
  50. JPORT3    =    2*2                  ;Works for Read_JoyStick() only.
  51. JPORT4    =    3*2                  ;Works for Read_JoyStick() only.
  52.  
  53. * --- Raster/Copper commands for RasterLists.
  54. *
  55. *Examples of how to use these commands/macros in a rasterlist:
  56. *
  57. * COL12      <ColourNumber>,<$0RGB>
  58. * COL24      <ColourNumber>,<$00RR>,<$GGBB>
  59. * COL12LIST  <StartLine>,<Skip>,<Colour>,<ColourList>
  60. * COL24LIST  <StartLine>,<SKip>,<Colour>,<ColourList>
  61. * SPRITE     <SpriteStruct>
  62. * SCROLL     <Fields>,<PixelOffset 0-16>,<PixelQuarterOffset 1-4>
  63. * FLOOD      
  64. * REPOINT    <BitplanePtr>
  65. * MIRROR     
  66. * NEWPALETTE <ColStart>,<AmtCols>,<Palette>
  67. * WAITLINE   <Line>
  68. * RASTEND
  69. *
  70. * Warn: With colour related commands you must use the same amount of colour
  71. * bits as specified in your GameScreen structure (_12BITCOL or _24BITCOL)
  72.  
  73. COL12Len =    10               ;COL12,Line,Colour,RGB
  74. COL12LISTLen =    16               ;COL12LIST,Line,Skip,Colour,RGB
  75. COL24LISTLen =    16               ;COL24LIST,Line,Skip,Colour,RRGGBB
  76. COL24Len =    12               ;COL24,Line,Colour,RRGGBB
  77. SPRITELen =    10               ;SPRITE,Line,SpriteStruct
  78. SCROLLLen =    8                ;SCROLL,Line,Offset
  79. FSCROLLLen =    10               ;FSCROLL,Line,Offset
  80. FLOODLen =    6                ;FLOOD,Line
  81. REPOINTLen =    10               ;REPOINT,Line,BitPtr
  82. MIRRORLen =    6                ;MIRROR,Line
  83. NEWPALETTELen = 14               ;NEWPALETTE,Line,ColStart,AmtCols,Palette
  84. WAITLINELen =    8
  85.  
  86. WAITLINE MACRO    ;<Line>
  87.     dc.w    11,\1
  88.     dc.l    0
  89.     ENDM
  90.  
  91. COL12    MACRO   ;<ColourNumber>,<$0RGB>
  92.     dc.w    00,\1,\2
  93.     dc.l    0              ;Reserved.
  94.     ENDM
  95.  
  96. COL24    MACRO   ;<ColourNumber>,<$00RR>,<$GGBB>
  97.     dc.w    01,\1
  98.     dc.l    \2
  99.     dc.l    0              ;Reserved.
  100.     ENDM
  101.  
  102. COL12LIST MACRO    ;<Line> <Skip> <Colour> <ColourList>
  103.     dc.w    02,\1,\2,\3
  104.     dc.l    \4
  105.     dc.l    0              ;Reserved.
  106.     ENDM
  107.  
  108. COL24LIST MACRO    ;<Line> <Skip> <Colour> <ColourList>
  109.     dc.w    03,\1,\2,\3
  110.     dc.l    \4
  111.     dc.l    0              ;Reserved.
  112.     ENDM
  113.  
  114. SPRITE    MACRO   ;<SpriteStruct>
  115.     dc.w    04
  116.     dc.l    \2
  117.     dc.l    0              ;Reserved.
  118.     ENDM
  119.  
  120. SCROLL    MACRO   ;<Fields>,<PixelOffset (0..16)>
  121.     dc.w    05,\1,\2,\3
  122.     dc.l    0              ;Reserved.
  123.     ENDM
  124.  
  125. FSCROLL    MACRO   ;<Fields>,<PixelOffset (0..16)>,<(0..4)>
  126.     dc.w    06,\1,\2,\3,\4
  127.     dc.l    0              ;Reserved.
  128.     ENDM
  129.  
  130. FLOOD    MACRO
  131.     dc.w    07
  132.     dc.l    0              ;Reserved.
  133.     ENDM
  134.  
  135. REPOINT    MACRO   ;<BitplanePtr>
  136.     dc.w    08
  137.     dc.l    \2
  138.     dc.l    0              ;Reserved.
  139.     ENDM
  140.  
  141. MIRROR    MACRO
  142.     dc.w    09
  143.     dc.l    0              ;Reserved.
  144.     ENDM
  145.  
  146. NEWPALETTE MACRO ;<ColStart>,<AmtCols>,<Palette>
  147.     dc.w    10,\1,\2
  148.     dc.l    \3
  149.     dc.l    0              ;Reserved.
  150.     ENDM
  151.  
  152. RASTEND    MACRO
  153.     dc.l    -1
  154.     ENDM
  155.  
  156. * --- GPI ID numbers.
  157.  
  158. GPI_SCREENS =  0
  159. GPI_BLITTER =  1
  160. GPI_SOUND   =  2
  161. GPI_NETWORK =  3
  162. GPI_VECTORS =  4
  163. GPI_DEBUG   =  5
  164.  
  165. * --- Standard screen structure.
  166.  
  167.    STRUCTURE    GameScreen,0          ;A GameScreen structure
  168.     ULONG    SS_VERSION            ;Vesion - "GSV1"
  169.     APTR    SS_MemPtr1            ;Ptr to screen 1
  170.     APTR    SS_MemPtr2            ;Ptr to screen 2 (if buffered).
  171.     APTR    SS_MemPtr3            ;Ptr to screen 3 (triple buffer!!)
  172.     APTR    SS_ScreenLink         ;Ptr to a linked screen.
  173.     APTR    SS_Palette            ;Ptr to the screen palette.
  174.     APTR    SS_RasterList         ;Ptr to a raster list (or not).
  175.     ULONG    SS_AmtColours         ;The amount of colours on screen.
  176.     UWORD    SS_Scr_Height         ;The height of the visible screen.
  177.     UWORD    SS_Scr_Width          ;The width of the visible screen.
  178.     UWORD    SS_Scr_ByteWidth      ;Width of the screen in *bytes*.
  179.     UWORD    SS_Pic_Height         ;The height of the entire screen.
  180.     UWORD    SS_Pic_Width          ;The width of the entire screen.
  181.     UWORD    SS_Pic_ByteWidth      ;Width of the entire screen, bytes.
  182.     UWORD    SS_Planes             ;The amount of planes in da screen.
  183.     WORD    SS_TopOfScrX          ;Hardware co-ordinate for TOS.
  184.     WORD    SS_TopOfScrY          ;Hardware co-ordinate for LOS.
  185.     UWORD    SS_ScrollBuffer       ;Scroll buffer in pixels.
  186.     WORD    SS_ScrollXCount       ;Offset of the horizontal axis.
  187.     WORD    SS_ScrollYCount       ;Offset of the vertical axis.
  188.     ULONG    SS_ScrAttrib          ;Special Attributes are?
  189.     UWORD    SS_ScrMode            ;What screen mode is it?
  190.     UBYTE    SS_ScrType            ;Interleaved/Planar/Chunky?
  191.     UBYTE    SS_Displayed          ;Am I currently displayed?
  192.     APTR    SS_Extended           ;For extended tag lists.
  193.     APTR    SS_ScreenStats
  194.     LABEL    GSV1_SIZEOF
  195.  
  196. INTERLEAVED =    0                     ;SCREEN TYPES.
  197. PLANAR =    1
  198. CHUNKY =    2
  199.                                       ;SCREEN ATTRIBUTES.
  200. DBLBUFFER =    $00000001             ;For double buffering.
  201. TPLBUFFER =    $00000002             ;Triple buffering!!
  202. PLAYFIELD =    $00000004             ;Set if it's part of a playfield.
  203. HSCROLL =    $00000008             ;Gotta set this to do scrolling.
  204. VSCROLL =    $00000010             ;For vertical scrolling.
  205. SPRITES =    $00000020             ;Set this if you want sprites.
  206. ; =        $00000040             ;
  207. NOBURST =    $00000080             ;This forces burst mode to off.
  208. BLKBDR =    $00000100             ;Gives a blackborder on AGA machines.
  209. NOSPRBDR =    $00000200             ;For putting sprites in the border.
  210. ; =        $00000400             ;If child is at top of screen.
  211. SPR32 =        $00000800             ;Set one of these if you will
  212. SPR64 =        $00001000             ;  be using sprites larger than
  213. ;SPR128 =    $00002000             ;  16 pixels width (AGA only!)
  214. ;SPR256 =    $00004000
  215. ;EXTENDME =    $80000000             ;Reserved.
  216.  
  217.                                       ;SCREEN MODES.
  218. LORES =        $0000                 ;Low resolution (default).
  219. HIRES =        $0001                 ;High resolution.
  220. SHIRES =    $0002                 ;Super-High resolution.
  221. INTERLACED =    $0004                 ;Interlaced.
  222. ;??? =        $0008                 ;Reserved.
  223. ;??? =        $0010                 ;Reserved.
  224. NTSC =        $0020                 ;Set if you wrote this game in NTSC.
  225. HAM =        $0040                 ;For HAM mode.
  226. _24BITCOL =    $0080                 ;24Bit colours (otherwise it's 12Bits).
  227.  
  228. B_DBLBUFFER =    0
  229. B_TPLBUFFER =    1
  230. B_PLAYFIELD =    2
  231. B_HSCROLL =    3
  232. B_VSCROLL =    4
  233. B_SPRITES =    5
  234. ;B_??? =    6
  235. B_NOBURST =    7
  236. B_BLKBDR =    8
  237. B_BDRSPRITES =    9
  238. ;B_??? =    10
  239. B_SPR32 =    11
  240. B_SPR64 =    12
  241. ;B_SPR128 =    13
  242. ;B_SPR256 =    14
  243.                           ;SCREEN MODES - Bit flags.
  244. B_LORES =       0         ;Low resolution (default).
  245. B_HIRES =       1         ;High resolution.
  246. B_SUPERHI =     2         ;Interlaced.
  247. B_INTERLACED =  3         ;Super-High resolution.
  248. ;??? =          4         ;Reserved.
  249. B_NTSC =        5         ;Reserved.
  250. B_HAM =         6         ;Set if you wrote this game in NTSC.
  251. B_24BITCOL =    7         ;For HAM mode.
  252. ;??? =          8         ;24Bit colours (otherwise it's 12Bits).
  253.  
  254. * --- Universal errorcodes returned by certain functions.
  255.  
  256. ERR_OK    =  0            ;Function went OK.
  257. ERR_NOMEM =  1            ;Not enough memory available.
  258. ERR_NOPTR =  2            ;Relevant ptr not present.
  259. ERR_INUSE =  3            ;Previous allocations have not been freed.
  260. ERR_NOVER =  4            ;Structure version not supported/not found.
  261.  
  262. * --- Sprite structure
  263.  
  264.    STRUCTURE    SpriteStruct,0
  265.     UWORD    SPR_Number
  266.     APTR    SPR_Address           ;Pointer to Sprite graphic.
  267.     WORD    SPR_XPos              ;X position (screen relative).
  268.     WORD    SPR_YPos              ;Y position (screen relative).
  269.     UWORD    SPR_Frame             ;Current frame number.
  270.     UWORD    SPR_Width             ;Width in pixels.
  271.     UWORD    SPR_Height            ;Height in pixels.
  272.     UWORD    SPR_AmtColours        ;4/16
  273.     UWORD    SPR_ColStart          ;000/016/032/064/096/128/160/192/224
  274.     UWORD    SPR_Planes            ;2/4
  275.     UWORD    SPR_Resolution        ;HIRES/LORES/SHIRES/XLONG
  276.     ULONG    SPR_SpriteSize        ;Reserved.
  277.     ULONG    SPR_FrameSize         ;Reserved.
  278.     LABEL    SPR_SIZEOF
  279.  
  280. SPR_OCS =  $0010                      ;Standard OCS sprite.
  281. SPR_AGA =  $0020                      ;Standard AGA sprite.
  282. XLONG =    $0040                      ;Double the width (uses extra bank). 
  283.  
  284.  
  285. * --- BOB structure
  286.  
  287.    STRUCTURE    BOBStruct,0
  288.     UWORD    BOB_Frame             ;Current frame.
  289.     APTR    BOB_FrameList         ;Pointer to frame list.
  290.     WORD    BOB_XPos              ;X position.
  291.     WORD    BOB_YPos              ;Y position.
  292.     UWORD    BOB_Height            ;Height
  293.     UWORD    BOB_ByteWidth         ;Width in bytes
  294.     WORD    BOB_ClipLeft          ;"Clip Area" border restrictions.
  295.     WORD    BOB_ClipTop
  296.     WORD    BOB_ClipRight
  297.     WORD    BOB_ClipBottom
  298.     UWORD    BOB_Attributes        ;Mask/Chunky/Planar/Interleaved
  299.     UWORD    BOB_AmtPlanes         ;Amt of planes.
  300.     UWORD    BOB_FirstPlane        ;Planar only.
  301.     UWORD    BOB_DrawMethod
  302.     UWORD    BOB_BackGrndInfo      ;Is a background stored?
  303.     APTR    BOB_BackGrndPtr       ;Where is the background stored?
  304.  
  305.     APTR    FB_Draw_Routine       ;Private stuff here.
  306.     APTR    FB_Clear_Routine      ;Don't even dare touch this stuff!
  307.     ULONG    FB_BlitSize
  308.     ULONG    FB_Modulo1
  309.     ULONG    FB_Modulo2
  310.     WORD    FB_LineSize
  311.     WORD    FB_BotCut
  312.     WORD    FB_TBWidth
  313.     WORD    FB_ejijoj
  314.     LABEL    BOB_SIZEOF
  315.  
  316. ;* --- BOB Drawing Methods
  317.                               ;INTERLEAVED
  318. INTLV_NCNM = 00 ;No clip, no mask.    ;Takes the shortest time
  319. INTLV_NCYM = 01 ;No clip, masked.     ;...
  320. INTLV_YCNM = 02 ;Clip, no mask.       ;...
  321. INTLV_YCYM = 03 ;Clip, masked.        ;Takes the longest time
  322.  
  323.                               ;PLANAR
  324. PLNR_NCNM = 04 ;No clip, no mask.     ;Takes the shortest time
  325. PLNR_NCYM = 05 ;No clip, masked.      ;...
  326. PLNR_YCNM = 06 ;Clip, no mask.        ;...
  327. PLNR_YCYM = 07 ;Clip, masked.         ;Takes the longest time
  328.  
  329.                               ;CHUNKY
  330. CHNKY_NCNM = 08 ;No clip, no mask.    ;Takes the shortest time
  331. CHNKY_NCYM = 09 ;No clip, masked.     ;...
  332. CHNKY_YCNM = 10 ;Clip, no mask.       ;...
  333. CHNKY_YCYM = 11 ;Clip, masked.        ;Takes the longest time
  334.  
  335.  
  336. ;* --- Sound stuff
  337.  
  338. CHAN_FREE =    0                     ;For Check_Channel()
  339.  
  340. CHANNEL_ALL =    -1
  341. CHANNEL_1 =    0
  342. CHANNEL_2 =    1
  343. CHANNEL_3 =    2
  344. CHANNEL_4 =    3
  345.  
  346. RAW =    0
  347. IFF =    1
  348. WAV =    2
  349.  
  350.    STRUCTURE    SoundStruct,00
  351.     UWORD    SAM_Type              ;IFF/WAV/RAW/
  352.     UWORD    SAM_Channel           ;Channel, 0-3
  353.     WORD    SAM_Priority          ;Priority, 0-127.
  354.     ULONG    SAM_Address           ;Address of sample data.
  355.     UWORD    SAM_Length            ;Length of sample data in WORDS.
  356.     UWORD    SAM_Period            ;Speed of playback.
  357.     UWORD    SAM_Volume            ;Volume of sample.
  358.     LABEL    SAM_SIZEOF
  359.  
  360. * --- Choose one of these for calling Set_Interrupt().
  361.  
  362. INTB_INTEN =    14                    ;Master interrupt (enable only )
  363. INTB_EXTER =    13                    ;External interrupt
  364. INTB_DSKSYNC =    12                    ;Disk re-SYNChronized
  365. INTB_RBF =    11                    ;serial port Receive Buffer Full
  366. INTB_AUD3 =    10                    ;Audio channel 3 block finished
  367. INTB_AUD2 =    9                     ;Audio channel 2 block finished
  368. INTB_AUD1 =    8                     ;Audio channel 1 block finished
  369. INTB_AUD0 =    7                     ;Audio channel 0 block finished
  370. INTB_BLIT =    6                     ;Blitter finished
  371. INTB_VERTB =    5                     ;start of Vertical Blank
  372. INTB_COPER =    4                     ;Coprocessor
  373. INTB_PORTS =    3                     ;I/O Ports and timers
  374. INTB_SOFTINT =    2                     ;software interrupt rest
  375. INTB_DSKBLK =    1                     ;Disk Block done
  376. INTB_TBE =    0                     ;serial port Transmit Buffer Empty
  377.  
  378. * --- Special Keypresses that can be returned from Read_Key().  All other
  379. * keys can be considered to be in ASCII format.
  380.  
  381.  STRUCTURE    KP,00
  382.     WORD    KP_ID    ;GMS Identification - ignore.
  383.     BYTE    KP_Qualifier1    ;This is the most recent qualifier
  384.     BYTE    KP_Key1    ;and keypress.
  385.     BYTE    KP_Qualifier2
  386.     BYTE    KP_Key2
  387.     BYTE    KP_Qualifier3    ;This is the oldest qualifier and
  388.     BYTE    KP_Key3    ;keypress.
  389.     LABEL    KP_SIZEOF
  390.  
  391. K_BAKSPC =    $80
  392. K_DEL    =    $81
  393. K_HELP    =    $82
  394.  
  395. K_LSHIFT =    $83
  396. K_RSHIFT =    $84
  397. K_CAPS =    $85
  398. K_CTRL =    $86
  399. K_LALT =    $87
  400. K_RALT =    $88
  401. K_LAMIGA =    $89
  402. K_RAMIGA =    $8a
  403.  
  404. K_F1    =    $8b
  405. K_F2    =    $8c
  406. K_F3    =    $8d
  407. K_F4    =    $8e
  408. K_F5    =    $8f
  409. K_F6    =    $90
  410. K_F7    =    $91
  411. K_F8    =    $92
  412. K_F9    =    $93
  413. K_F10    =    $94
  414. K_F11    =    $95
  415. K_F12    =    $96
  416. K_F13    =    $97
  417. K_F14    =    $98
  418. K_F15    =    $99
  419. K_F16    =    $9a
  420. K_F17    =    $9b
  421. K_F18    =    $9c
  422. K_F19    =    $9d
  423. K_F20    =    $9e
  424.  
  425. C_UP    =    $9f
  426. C_DOWN    =    $a0
  427. C_RIGHT    =    $a1
  428. C_LEFT    =    $a2
  429.  
  430. K_SRIGHT =    $a3                   ;Special key on right.
  431. K_SLEFT =    $a4                   ;Special key on left.
  432.  
  433. * --- Special keys that are recognised under ASCII (here for convenience).
  434.  
  435. K_ENTER =    10
  436. K_RETURN =    10
  437. K_TAB    =    09
  438. K_ESC    =    ""
  439.  
  440.  
  441.